<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.3.1.min.js"></script>
</head>
<body>
用户名：<input name="username" id="username">
<br>
密码：<input type="password" name="password" id="password">
<br>
<button id="login_btn">登录</button>
</body>
<script>
    $(function(){
        $("#login_btn").click(function(){
            var username = $('#username').val();
            var password = $('#password').val();
            $.ajax({
                url: '/login?username='+username + '&password='+ password,
                success:function (result) {
                    if(result === 'ok'){
                        alert("登陆成功")
                    }else{
                        alert("登陆失败")
                    }


                }
            });
        });
    })
</script>
</html>